]> dgit.raspbian.org Git - gnome-shell.git/commit
workspace: Port WorkspaceBackground allocate to C
authorIvan Molodetskikh <yalterz@gmail.com>
Sun, 10 Jul 2022 05:13:15 +0000 (22:13 -0700)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 3 Aug 2022 12:30:31 +0000 (12:30 +0000)
commit83564e59b3f041954238ffc89060adc84973bc98
treef44bc5d2158d4330ab6ad42ee9093c446fc94de5
parent1fd08e80ed9e1976ddc719aaedb83f4aa9f989de
workspace: Port WorkspaceBackground allocate to C

WorkspaceBackground's allocate is a hot function called every frame
during overview animations. Port it to C.

While we're at it, cache the work area and the monitor geometry, which
do not need to be re-fetched on every allocation.

This reduces the average WorkspaceBackground allocation time from
0.134 ms to 0.017 ms. With four workspaces, scrolling the overview sees
an average WorkspacesView allocation time improvement from
1.104 ms to 0.678 ms.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2394>
js/ui/workspace.js
src/meson.build
src/shell-workspace-background.c [new file with mode: 0644]
src/shell-workspace-background.h [new file with mode: 0644]